<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="layout" content="main">
    <title>Creacion de personal en el taller</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
    <script>
      jQuery(function() {
      jQuery( "#tabs" ).tabs();
      });
    </script>
  </head>
  <body>
    <div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="list" action="logout" controller="LogIn">Cerrar sesion</g:link></li>
                        </ul>
</div>
    <div id="tabs">
      <ul>
        <li><a href="#tabs-1">Crear Tecnico</a></li>
        <li><a href="#tabs-2">Crear Cliente</a></li>
      </ul>
      <div id="tabs-1">
        <g:form action="save" controller="MechanicalTechnician">
          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'name', 'error')} required">
            <label for="name">
              <g:message code="mechanicalTechnician.name.label" default="Name" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="name" required="" value="${mechanicalTechnicianInstance?.name}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'speciality', 'error')} required">
            <label for="speciality">
              <g:message code="mechanicalTechnician.speciality.label" default="Speciality" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="speciality" required="" value="${mechanicalTechnicianInstance?.speciality}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'address', 'error')} required">
            <label for="address">
              <g:message code="mechanicalTechnician.address.label" default="Address" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="address" required="" value="${mechanicalTechnicianInstance?.address}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'phone', 'error')} required">
            <label for="phone">
              <g:message code="mechanicalTechnician.phone.label" default="Phone" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="phone" maxlength="10" required="" value="${mechanicalTechnicianInstance?.phone}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'password', 'error')} required">
            <label for="password">
              <g:message code="mechanicalTechnician.password.label" default="Password" />
              <span class="required-indicator">*</span>
            </label>
            <g:passwordField name="password" maxlength="15" required="" value="${mechanicalTechnicianInstance?.password}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'repairShop', 'error')} required">
            <!--<label for="repairShop">
<g:message code="mechanicalTechnician.repairShop.label" default="Repair Shop" />
                    <span class="required-indicator">*</span>
            </label>
<g:select id="repairShop" name="repairShop.id" from="${your_car_status.RepairShop.list()}" optionKey="id" required="" value="${mechanicalTechnicianInstance?.repairShop?.id}" class="many-to-one"/>-->
            <g:hiddenField id="repairShop" name="repairShop.id" required=""  value="${mechanicalTechnicianInstance?.repairShop?.id}"></g:hiddenField>
          </div>

          <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'username', 'error')} ">
            <label for="username">
              <g:message code="mechanicalTechnician.username.label" default="Username" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="username" required="" value="${mechanicalTechnicianInstance?.username}"/>
          </div>
          <fieldset class="buttons">
            <g:submitButton name="create" class="save" value="Crear nuevo tecnico" />
          </fieldset>
        </g:form>
      </div>
      <div id="tabs-2">
        <g:form action="save" controller="Customer">
          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'identification', 'error')} required">
            <label for="identification">
              <g:message code="customer.identification.label" default="Identification" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="identification" required="" value="${customerInstance?.identification}"/>
          </div>  
          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'email', 'error')} required">
            <label for="email">
              <g:message code="customer.email.label" default="Email" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="email" required="" value="${customerInstance?.email}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'name', 'error')} required">
            <label for="name">
              <g:message code="customer.name.label" default="Name" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="name" required="" value="${customerInstance?.name}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'password', 'error')} required">
            <label for="password">
              <g:message code="customer.password.label" default="Password" />
              <span class="required-indicator">*</span>
            </label>
            <g:textField name="password" maxlength="15" required="" value="${customerInstance?.password}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'address', 'error')} ">
            <label for="address">
              <g:message code="customer.address.label" default="Address" />

            </label>
            <g:textField name="address" value="${customerInstance?.address}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'phoneNumber', 'error')} ">
            <label for="phoneNumber">
              <g:message code="customer.phoneNumber.label" default="Phone Number" />

            </label>
            <g:textField name="phoneNumber" value="${customerInstance?.phoneNumber}"/>
          </div>

          <div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'repairShop', 'error')} required">
            <!--<label for="repairShop">
<g:message code="customer.repairShop.label" default="Repair Shop" />
                    <span class="required-indicator">*</span>
            </label>
<g:select id="repairShop" name="repairShop.id" from="${your_car_status.RepairShop.list()}" optionKey="id" required="" value="${customerInstance?.repairShop?.id}" class="many-to-one"/>-->
            <g:hiddenField id="repairShop" name="repairShop.id" required="" value="${customerInstance?.repairShop?.id}" />
          </div>
          <fieldset class="buttons">
            <g:submitButton name="create" class="save" value="Crear nuevo cliente" />
          </fieldset>
        </g:form>
      </div>
    </div>
  </body>
</html>
